document.writeln("<script type=\"text\/javascript\" src=\"lib\/jquery\/jquery.ui.core.js\"><\/script>");
document.writeln("<script type=\"text\/javascript\" src=\"lib\/jquery\/jquery.ui.datepicker.js\"><\/script>");
document.writeln("<script type=\"text\/javascript\" src=\"lib\/jquery\/i18n/jquery.ui.datepicker-zh-CN.js\"><\/script>");
document.writeln("<script type=\"text\/javascript\" src=\"lib\/jquery\/i18n/jquery.ui.datepicker-zh-TW.js\"><\/script>");

document.writeln("<script type=\"text\/javascript\" src=\"lib\/jquery\/jquery.bw.bbcode.js\"><\/script>");
document.writeln("<script type=\"text\/javascript\" src=\"lib\/jquery\/jquery.bw.copyer.js\"><\/script>");

$(document).ready(function(){
    $("#if_elite_begin").datepicker({changeMonth: true, changeYear: true, yearRange: '-50:+50', dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: 'template/default/{$dir_images}/icon_calendar.gif', buttonImageOnly: true});
    $("#if_elite_end").datepicker({changeMonth: true, changeYear: true, yearRange: '-50:+50', dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: 'template/default/{$dir_images}/icon_calendar.gif', buttonImageOnly: true});
    $("#if_top_begin").datepicker({changeMonth: true, changeYear: true, yearRange: '-50:+50', dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: 'template/default/{$dir_images}/icon_calendar.gif', buttonImageOnly: true});
    $("#if_top_end").datepicker({changeMonth: true, changeYear: true, yearRange: '-50:+50', dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: 'template/default/{$dir_images}/icon_calendar.gif', buttonImageOnly: true});
    $("#if_close_begin").datepicker({changeMonth: true, changeYear: true, yearRange: '-50:+50', dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: 'template/default/{$dir_images}/icon_calendar.gif', buttonImageOnly: true});
    $("#if_close_end").datepicker({changeMonth: true, changeYear: true, yearRange: '-50:+50', dateFormat: 'yy-mm-dd', showOn: 'button', buttonImage: 'template/default/{$dir_images}/icon_calendar.gif', buttonImageOnly: true});

    $("#content").bwbbcode();
    $("#content").keydown(function(event){
        if(event.ctrlKey && event.keyCode == 13) {
            $("#button_submit").click(); 
        }
    });
});

